package cn.wolfcode.cloud.shop.redis;

import lombok.Getter;

import java.util.concurrent.TimeUnit;

/**
 * @author Administrator
 */

@Getter
public enum MemberRedisKey {

    //用户token令牌
    USER_TOKEN("userToken:",30L,TimeUnit.MINUTES);

    private String prefix;

    private Long expireTime;

    private TimeUnit timeUnit;


    MemberRedisKey(String prefix){
        this(prefix,0L,null);
    }

    MemberRedisKey(String prefix,Long expireTime,TimeUnit timeUnit){
        this.prefix = prefix;
        this.expireTime = expireTime;
        this.timeUnit = timeUnit;
    }

    public String getRealKey(String key){
        return  this.prefix + key;
    }

}
